<?php
namespace Hui\FrontEndBundle\Logic;


use Hui\StoreBundle\Entity\LoaiSanPham;

class MenuLogic {
	//connection
	private $connection;
	
	function __construct($connection) {
		$this->connection = $connection;
	}
	
	//get all loai may anh
	public function getAllLoaiMayAnh() {
		$em = $this->connection;
		return $em->getRepository('HuiStoreBundle:LoaiSanPham')
						->getAllLoaiSanPham(LoaiSanPham::LOAI_MAY_ANH);
	}
	
	//get all loai may quay
	public function getAllLoaiMayQuay() {
		$em = $this->connection;
		return $em->getRepository('HuiStoreBundle:LoaiSanPham')
						->getAllLoaiSanPham(LoaiSanPham::LOAI_MAY_QUAY);
	}
	
	//get all nha san xuat
	public function getAllNhaSanXuat() {
		$em = $this->connection;
		return $em->getRepository('HuiStoreBundle:NhaSanXuat')
						->getAllNhaSanXuat();
	}
	
}